//
//  BSImageVC.m
//  BS
//
//  Created by lanou on 15/8/17.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "BSImageVC.h"

#import "Header.h"

#import "UIImageView+WebCache.h"
#import "BSUserSetting.h"
@interface BSImageVC ()

@property (strong, nonatomic) IBOutlet UIScrollView *scrollView;
@end

@implementation BSImageVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createImageView];
}

- (void)createImageView{

    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, (SCREEN_WIDTH) / [_model.width floatValue] * [_model.height floatValue])];
    [imageView sd_setImageWithURL:[NSURL URLWithString:_model.cdn_img]];
    imageView.userInteractionEnabled = YES;
    UIGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dotap:)];
    [imageView addGestureRecognizer:tap];
    [self.scrollView addSubview:imageView];
    self.scrollView.contentSize = imageView.bounds.size;
}


- (void)dotap:(UIGestureRecognizer *)tap{

    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
